<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
<link href="./css/modern.css" rel="stylesheet"> 
<link href="./css/style-student-group.css" rel="stylesheet" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
</head>
<%@ page import="java.util.ArrayList" %>
<%
	String courseNumber = (String) request.getAttribute("courseNumber");
	String sectionNumber = (String) request.getAttribute("sectionNumber");
	String firstname = (String) request.getAttribute("firstname");
	String lastname = (String) request.getAttribute("lastname");
	String TAID = (String) request.getAttribute("TAID");
	String COGSName = (String) request.getAttribute("COGSName");
	String division = (String) request.getAttribute("division");
	String empty = (String) request.getAttribute("empty");
	String viewButton = (String) request.getAttribute("viewButton");
	ArrayList<String> IndGrades = (ArrayList<String>) request.getAttribute("IndGrades");
	ArrayList<String> GroupGrades = (ArrayList<String>) request.getAttribute("GroupGrades");
	
	
%>
<body>
<div id="containerAssessments">
	<div id="header"><br>
		<h1 id="main-title"><b><font color = "000000">EECE Student Group Assessments</b></font></h1>
		<h2>
			<a href="index.html">
			<p align="right"><font size = "4">Logout</font></p>
			</a>
		</h2>		
	</div>
    <div id="body" class="page-region-content tiles"><br>
     <div id="innerBody" class="page-region-content tiles" align="center">
		<h1><%=courseNumber%> Section <%=sectionNumber%> COGS Assessment </h1>
<form action="TACommitGradesServlet" id="myform" method="get">
<table cellspacing="0" cellpadding="0" border="0" width="325" class="striped" border=1>
  <tr>
    <td>
       <table cellspacing="0" cellpadding="1" border="0" width="300"class="striped" border=1 >
         <tr>
            <th>Student List</th>
         </tr>
       </table>
    </td>
  </tr>
  <tr>
    <td>
       <div style="100%; height:150px; width: 1000px; overflow:auto;">
         <table class="fixed" cellspacing="0" cellpadding="1" border="0" width="300" class="striped" border=1>
           <tr>
           		<td><b>Group:</b></td>
           		<c:forEach items="${TADutyInfo}" var="Info">
				<td><c:out value="${Info.groupnumber}"/></td>
				</c:forEach>
           </tr>
           
           <tr>
          	    <td><b>Student to Grade:</b></td>
				<c:forEach items="${TADutyInfo}" var="Info">
				<td><c:out value="${Info.firstname}" />  <c:out value="${Info.lastname}" /></td>
				</c:forEach>
           </tr>


           
           <tr>
           		<td><b>Room:</b></td>
          		<c:forEach items="${TADutyInfo}" var="Info">
           		<td><c:out value="${Info.rooM}" /></td>
           		</c:forEach>
           </tr>
           
            <tr>
           		<td><b>Start:</b></td>
           		<c:forEach items="${TADutyInfo}" var="Info">
           		<td><c:out value="${Info.starttime}" /></td>
           		</c:forEach>
           </tr>
           
           <tr>
           		<td><b>End:</b></td>
           		<c:forEach items="${TADutyInfo}" var="Info">
           		<td><c:out value="${Info.endtime}" /></td>
           		</c:forEach>
           </tr>
         </table>  
       </div>
    </td>
  </tr>
</table>


<table cellspacing="0" cellpadding="0" border="0" width="325" class="striped" border=1>
  <tr>
    <td>
       <table cellspacing="0" cellpadding="1" border="0" width="300"class="striped" border=1 >
         <tr>
            <th>Attendance</th>
         </tr>
       </table>
    </td>
  </tr>
  <tr>
    <td>
       <div style="100%; height:275px; width: 1105px; overflow:auto;">
         <table class="fixed" cellspacing="0" cellpadding="1" border="0" width="300" class="striped" border=1>

       
           <tr>

           		<td><b>Students:</b></td>
           		<c:forEach items="${studentList}" var="List">
				<td><c:forEach items="${List}" var="student">  <c:out value="${student.firstName}"/> <c:out value="${student.lastName}"/> 
				 <br> </c:forEach></td>
				 <td><c:forEach items="${List}" var="student"> P: <input type="checkbox" name="Attend" value="${student.studentID}P"> A: <input type="checkbox" name="Attend" value="${student.studentID}A">
				 <br> </c:forEach></td>
				</c:forEach>
           </tr>
         </table>  
       </div>
    </td>
  </tr>
</table>

<table cellspacing="0" cellpadding="0" border="0" width="325" class="striped" border=1>
  <tr>
    <td>
       <table cellspacing="0" cellpadding="1" border="0" width="300"class="striped" border=1 >
         <tr>
            <th>Grades</th>
         </tr>
       </table>
    </td>
  </tr>
  <tr>
    <td>
       <div style="100%; height:75px; width: 1000px; overflow:auto;">
         <table class="fixed" cellspacing="0" cellpadding="1" border="0" width="300" class="striped" border=1>
        	 <tr>
           		<td><b>Individual Grade:</b></td>
           		<% System.out.println(empty); %>
 
           		<%for(int i = 0; i< 6; i++) {%>
           		 <td> <input type="text"  size="5" name="IndGrade<%=(i+1)%>" 
           		 value="<%=IndGrades.get(i)%>"></td>
           		<%}%>
           </tr>
           
           <tr>
           		<td><b>Group Grade:</b></td>
           		<%for(int i = 0; i< 6; i++) {%>
           		  <td><input type="text" name="GroupGrade<%=(i+1)%>" 
           		  value="<%=GroupGrades.get(i)%>" size="5"></td>
           		<%}%>
           </tr>
         </table>  
       </div>
    </td>
  </tr>
</table>

<input type = "hidden" name = "courseNumber" value = "<%=courseNumber%>">
<input type = "hidden" name = "sectionNumber" value = <%=sectionNumber%>>
<input type = "hidden" name = "firstname" value = "<%=firstname%>">
<input type = "hidden" name = "lastname" value = <%=lastname%>>
<input type = "hidden" name = "TAID" value = "<%=TAID%>">
<input type = "hidden" name = "COGSName" value = <%=COGSName%>>
<input type = "hidden" name = "division" value = <%=division%>>
<input type = "hidden" name = "viewButton" value = "<%=viewButton%>">
<input type="submit" name="button" value="Finish Assessment">
</form>
</div>
	</div>
		<div id="footer">
			&copy;UBC Electrical and Computer Engineering. Styled with <a
				href="http://metroui.org.ua">Metro UI CSS</a>
		</div>
</div>
</body>
</html>